import json
from selenium.webdriver.support.wait import WebDriverWait
import os
basedir=os.path.dirname(__file__)
basePath="http://127.0.0.1:8000"

def ExplicitWait(driver,way,ele):
    return WebDriverWait(driver,2,0.5).until(lambda x:x.find_element(way,ele))
def load_LoginData(filepath):
    testdata = []
    with open(filepath, encoding='utf-8') as f:
        load_data = json.load(f)
    for data in load_data:
        testCase = data.get("testCase")
        username = data.get("username")
        password = data.get("password")
        msg = data.get("msg")
        testdata.append((testCase, username, password, msg))
    return testdata